package com.dongdongshop.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

@Configuration
public class FreemarkerConfig {

    @Bean//配置freemarker类
    public FreeMarkerConfigurer freeMarkerConfigurer(){
        FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
        //设置编码格式
        configurer.setDefaultEncoding("utf-8");
        //加载模板路径
        configurer.setTemplateLoaderPath("classpath:freemarker");
        return configurer;
    }
}
